<?php
namespace app\common\model;
use think\Model;
use traits\model\SoftDelete;
class Nav extends Model{
    protected static function init()
    {
        Nav::afterWrite(function ($model) {
            cache("cms_".$model['cms_id'],null);
        });
        Nav::afterUpdate(function ($model) {
            cache("cms_".$model['cms_id'],null);
        });
    }
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    public function getTargetTextAttr($value,$data)
    {
        $status = ["_self"=>'本页打开',"_blank"=>'新窗口打开'];
        return $status[$data['target']];
    }
}